#! /bin/sh

# Set messages on
set -x

# Demo for sudumptrace

#-------------------------------------------------
# Create a data set with suplane:
#   32 traces
#   tracl=1-32 tracr=1-32 offset=400 ns=64 dt=4000
#   The three dipping events cross on tracl=16

# Name temp data set
temp=tempdata.bin

#-------------------------------------------------

# Create temp data
suplane |

# Band-pass filter
sufilter f=10,20,40,50 |

# Change offset: each trace increments by 50 units
suchw key1=offset b=50 key2=tracl |

# Window: tracl=14-32, time = 80-160 ms.
suwind key=tracl min=14 tmin=0.080 tmax=0.160 > $temp

#-------------------------------------------------

# Plot temp data
suxwigb < $temp title="$temp" key=tracl \
          perc=100 hbox=600 wbox=400 \
          label1="Time (s)" label2="key tracl" &    

#-------------------------------------------------

# Dump key names, key values, trace values
sudumptrace < $temp num=3 \
              key=tracl,offset,tracr > dump.info &
 
#-------------------------------------------------

# Exit politely from shell
exit

